<div class="pageContent">

<script type="text/javascript">
				
				function showPL()
				{
					var payondelivery=document.getElementById("payondelivery");
					var cla = document.getElementById('Approvename');
					var orders = document.getElementById('orders');
					var pl = document.getElementById("showPL");
					var an = document.getElementById("Aname");
					if(payondelivery.checked){
						pl.style.display='block';
						an.style.display='none';
						orders.className="required";
						cla.className = "";
					}else{
						pl.style.display='none';
						an.style.display='block';
						orders.className="";
						cla.className = "required";
					}
				
				
				}
				
	function setpayaddVal() {
					
					
					//var quality=document.getElementById('quality').value;
					//金额
					var totalprice = document.getElementById('paymuch');
					//单价
					var price = document.getElementById('univalence');
					//量
					var quality = document.getElementById('capacity');
					//totalprice.value=quality*price;
					if(totalprice.value!=null&&totalprice.value!=""&&price.value!=null&&price.value!="")
					{
					  quality.value = (totalprice.value / price.value).toFixed(4);
					}
					else if(quality.value!=null&&quality.value!=""&&price.value!=null&&price.value!="")
					{
						totalprice.value=(quality.value*price.value).toFixed(4);
						
					}
				}
	function al(){
		alert('当调度记录为‘款到卸车’，此时客户未付款，卸车时提示与财务联系，需要在此页面操作，勾选提交即表示允许卸车，并能在收款信息查询');
	}
			</script>


	<form method="post"
		action="__URL__/payAdd/insertPay/true/navTabId/__MODULE__/callbackType/closeCurrent" class="pageForm required-validate"
		onsubmit="return validateCallback(this, dialogAjaxDone)">

		<input type="hidden" name="customerid" value="{$customerid}">
		<div class="pageFormContent" layoutH="58">
		    <p class="unit">
				<label>合同编号：</label> 
				<input name="contractno" class="required" readonly="readonly"  type="text"/>
				<input name="controlid" type="hidden">
				<input name="secondname" type="hidden">
				<a class="btnLook" href="__URL__/getcontract" lookupGroup="">查找带回</a>
			</p>
			<div class="unit">
				<label>付款方：</label> 
				<input type="text" class="required" name="payer" alt="请输入付款方" value="{$vo.customername}" size="58">
			</div>
			<div class="unit">
				<label>收款方：</label> 
				<input type="text" name="seller" class="required" size="58">
			</div>			
			<div class="unit">
				<label>收款金额：</label> 
				<input type="text" class="number" id="paymuch" name="paymuch" onblur="setpayaddVal();">
			</div>
				<div class="unit">
				<label>单价：</label> 
				<input type="text" class="number" id ="univalence" name="univalence" onblur="setpayaddVal();">
			</div>
				<div class="unit">
				<label>可审批吨数：</label> 
				<input type="text" class="number" id="capacity" name="capacity" onblur="setpayaddVal();">
			</div>
			<div class="unit">
				<label>收款日期：</label> 
				<input type="text" name="paytime" class="date" /><a class="inputDateButton" href="javascript:;">选择</a>
			</div>
			<p class="unit">
			<label style="margin-right: -10px;">款到卸车</label>
			<input name="payondelivery" id="payondelivery" type="checkbox" value="1"  onclick="showPL();"/>
			<a href="#" onclick="al();">说明</a> 
			</p>
			<p class="unit" id="showPL" style="display:none">
				<label>对应的调度：</label> 
				<input type="text" id="orders"  readonly="readonly" name="orders">
				<input type="hidden" name="Conid">
				<a class="btnLook" href="__URL__/getcon" lookupGroup="">查找带回</a>
			</p>
			
			<!-- 
			<div class="unit">
				<label>单价：</label> 
				<input type="text" readonly name="price">
			</div>
			 -->
			<div class="unit">
				<label>总额：</label> 
				<input type="text" readonly name="total">
			</div>
			<div class="unit">
				<label>已收款：</label> 
				<input type="text"  name="haspay" readonly>
			</div>
			<div class="unit">
				<label>未收款：</label> 
				<input type="text"    name="nopay" readonly>
			</div>
			<!-- 
			<p class="unit" id="Aname" style="display:block">
			<label>指定审批人：</label> 
			<input id="Approvename" class="required" name="Approvename" type="text" readonly="readonly"/>
			<input name="userid" type="hidden">
			<a class=" btnLook" href="__URL__/payAdd/chooseReceiver/true" lookupGroup="">查找带回</a>
			</p>
			 -->
				<div class="unit">
				<label>备注：</label>
				<TEXTAREA name="note" rows="3" cols="61" style="width: 357px;"></textarea>
			</div>
		</div>

		<div class="formBar">
			<ul>
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li><div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div></li>
			</ul>
		</div>
	</form>

</div>

